package com.lxw.api.media;

import com.lxw.framework.domain.media.response.CheckChunkResult;
import com.lxw.framework.model.response.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.multipart.MultipartFile;

@Api(value="媒资管理Controller",description = "负责媒资文件上传等功能")
public interface MediaUploadControllerApi {
    @ApiOperation("文件上传注册")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "文件md5信息",name = "fileMd5",dataType = "String",required = true),
            @ApiImplicitParam(value = "文件名",name = "fileName",dataType = "String"),
            @ApiImplicitParam(value = "文件大小",name = "fileSize",dataType = "Long"),
            @ApiImplicitParam(value = "文件类型",name = "mimetype",dataType = "String"),
            @ApiImplicitParam(value = "文件后缀",name = "fileExt",dataType = "String"),
    })
    ResponseResult register(String fileMd5,String fileName,Long fileSize,String mimetype,String fileExt);
    @ApiOperation("文件分片检查")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "文件md5信息",name = "fileMd5",dataType = "String",required = true),
            @ApiImplicitParam(value = "分片数",name = "chunk",dataType = "Integer"),
            @ApiImplicitParam(value = "文件后缀",name = "fileExt",dataType = "Integer"),
    })
    CheckChunkResult checkchunk(String fileMd5, Integer chunk, Integer chunkSize);
    @ApiOperation("文件分片上传")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "要上传的文件",name = "file",dataType = "MultipartFile",required = true),
            @ApiImplicitParam(value = "分片数",name = "chunk",dataType = "Integer"),
            @ApiImplicitParam(value = "文件md5信息",name = "fileMd5",dataType = "String"),
    })
    ResponseResult uploadchunk(MultipartFile file,Integer chunk,String fileMd5);
    @ApiOperation("文件上传注册")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "文件md5信息",name = "fileMd5",dataType = "String",required = true),
            @ApiImplicitParam(value = "文件名",name = "fileName",dataType = "String"),
            @ApiImplicitParam(value = "文件大小",name = "fileSize",dataType = "Long"),
            @ApiImplicitParam(value = "文件类型",name = "mimetype",dataType = "String"),
            @ApiImplicitParam(value = "文件后缀",name = "fileExt",dataType = "String"),
    })
    ResponseResult mergechunks(String fileMd5,String fileName,Long fileSize,String mimetype,String fileExt);
}
